"use client";
import { Show } from "@refinedev/antd";
import { useParsed, useShow } from "@refinedev/core";
import { Descriptions } from "antd";

export default function UserShow() {
  const { id } = useParsed();
  const { queryResult } = useShow({ 
    resource: "system/user",
    id: id
  });
  const record = queryResult?.data?.data;
  return (
    <Show>
      <Descriptions column={1} bordered size="middle">
        <Descriptions.Item label="用户ID">{record?.user_id}</Descriptions.Item>
        <Descriptions.Item label="用户名">{record?.user_name}</Descriptions.Item>
        <Descriptions.Item label="昵称">{record?.nick_name}</Descriptions.Item>
        <Descriptions.Item label="邮箱">{record?.email}</Descriptions.Item>
        <Descriptions.Item label="手机号">{record?.phonenumber}</Descriptions.Item>
        <Descriptions.Item label="性别">{record?.sex === '0' ? '男' : record?.sex === '1' ? '女' : '未知'}</Descriptions.Item>
        <Descriptions.Item label="状态">{record?.status === '0' ? '正常' : '停用'}</Descriptions.Item>
        <Descriptions.Item label="备注">{record?.remark}</Descriptions.Item>
      </Descriptions>
    </Show>
  );
} 